﻿namespace ctolua.Models
{
    /// <summary>
    /// 幻象
    /// </summary>
    public class MIllusion : MUnit
    {
        /// <summary>
        /// 复制目标
        /// </summary>
        public Unit clone_unit { get; set; }
        /// <summary>
        /// 幻象召唤者
        /// </summary>
        public Unit caller_unit => game_api.get_illusion_caller_unit(this.unit);
        public MIllusion(Unit unit) : base(unit)
        {

        }
        /// <summary>
        /// 创建幻象
        /// </summary>
        /// <param name="clone_unit ">  复制目标   </param>
        /// <param name="caller_unit ">  召唤者   </param>
        /// <param name="role ">  玩家   </param>
        /// <param name="pos ">  位置   </param>
        /// <param name="angle ">  朝向   </param>
        public MIllusion(Unit clone_unit, Unit caller_unit, Role role, Point pos, double angle, bool? clone_hp_mp)
        {
            this.clone_unit = clone_unit;
            this.unit = game_api.create_illusion(clone_unit, caller_unit, role, pos, py.Fix32(angle), clone_hp_mp);
        }


    }
}
